import 'package:flutter/material.dart';

class MyApp05 extends StatefulWidget {
   MyApp05({super.key ,required this.name});
  String name;

  @override
  State<MyApp05> createState() => _MyApp05State();
}

class _MyApp05State extends State<MyApp05> {
  String name = '';


  @override
  void initState() {
    // TODO: implement initState
    super.initState();
   name = widget.name;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('组件生命周期'),
        backgroundColor: Colors.pink,
      ),
      body: Center(
        child: Text('我是$name',style: TextStyle(fontSize: 10),),
      ),
    );
  }
}